<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:p="http://www.springframework.org/schema/p" 
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           ">


	<!-- ========================= GENERAL DEFINITIONS ========================= -->
	<!-- Transaction manager for a single JDBC DataSource -->
	<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory"><ref bean="sessionFactory"/></property>
	</bean>


	<bean id="stockDailyLineDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.StockDailyLineDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>	

	<bean id="stockCategoryDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.StockCategoryDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>

	<bean id="stockInfoDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.StockInfoDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>
	
	<bean id="stockDayIndicatorDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.StockDayIndicatorDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>

	<bean id="stockPerformanceDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.StockPerformanceDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>

	<bean id="exRightsDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>				
			</props>
		</property>
		<property name="target">
			<bean class="org.vsg.stock.basic.persistence.hibernate.ExRightsDaoImpl">
				<property name="sessionFactory"><ref bean="sessionFactory"/></property>
			</bean>
		</property>		
	</bean>



	<bean id="stockTickDao" class="org.vsg.stock.basic.persistence.file.StockTickDaoImpl">
		<property name="tickDir" value="${stock.tick.dir}"></property>
	</bean>
	<bean id="readTickFileProcessor" class="org.vsg.stock.basic.persistence.file.ZipReadTickFileProcessor"/>
	<!-- 
	<bean id="readTickFileProcessor" class="org.vsg.stock.basic.persistence.file.FolderReadTickFileProcessor"/>
 	-->		
</beans>